			<script>
				function addUser(){
					var nama_user 	= $("#nama_user").val();
					var username 	= $("#username").val();
					var password	= $("#password").val();
					var email	 	= $("#email").val();	
					var role	 	= $("#role").val();			
					$.ajax({
						url: "<?= base_url(); ?>user/add_user",
						type: "POST",
						data: "nama_user="+nama_user+"&username="+username+"&password="+password+"&email="+email+"&id_role="+role,
						success: function(msg){ 
							//alert(msg);
							window.location = "<?= base_url(); ?>user";
						}
					});
					
				}
				
				function deleteUser(id){
					$.ajax({
						url: "<?= base_url(); ?>user/delete_user",
						type: "POST",
						data: "id_user="+id,
						success: function(msg){
							window.location = "<?= base_url(); ?>user";
						}
					});
				}
				
				function updateUser(id,submit){
					if(submit == 'false'){
						$('#action-title').html("Edit User");
						$('#nama_user').val($('#nama_user'+id).html());
						$('#username').val($('#username'+id).html());
						$("#password").attr('disabled','disabled');
						$('#role').val($('#role'+id).html());
						$('#email').val($('#email'+id).html());
						$('#button_panel').html('<button class="btn" onclick="updateUser('+id+', true)">Simpan</button>');
					}
					else{
						var nama_user 	= $("#nama_user").val();
						var username 	= $("#username").val();
						var email	 	= $("#email").val();
						var role	 	= $("#role").val();
						
						$.ajax({
							url: "<?= base_url(); ?>user/update_user",
							type: "POST",
							data: "id_user="+id+"&nama_user="+nama_user+"&username="+username+"&email="+email+"&id_role="+role,
							success: function(msg){
									//alert(msg);
								window.location = "<?= base_url(); ?>user";					
							}
						});
					}
				}
				
			</script>
			
			<div id="user-edit">
			<?php $this->load->view('user/user_edit', array('NEW' => TRUE)); ?>
			</div></div></div>
			<div id="user-list">
				<div class="row-fluid sortable">		
					<div class="box span12">
						<div class="box-header well" data-original-title>
							<h2><i class="icon-user"></i> User</h2>
							<div class="box-icon">
								<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							</div>
						</div>
						<div class="box-content">
							<table class="table table-striped table-bordered bootstrap-datatable datatable">
							  <thead>
								  <tr>
									  <th>Nama User</th>
									  <th>Username</th>
									  <th>Email</th>
									  <th>Role</th>
									  <th class="center">Actions</th>
								  </tr>
							  </thead>   
							  <tbody>
								<?php $this->load->view('user/user_list'); ?>
							</tbody>
						  </table>            
						</div>
					</div><!--/span-->
			
				</div><!--/row-->
			</div>
			